<template>
    <div>
        <van-nav-bar 
            :title="$router.currentRoute.name" 
            left-text="返回" 
            left-arrow 
            @click-left="onClickLeft" 
            @click-right="onClickRight">
            <van-icon name="edit" slot="right" />
        </van-nav-bar>

        <van-pull-refresh v-model="isLoading" @refresh="onRefresh">
            <div class="list-wrapper">
                <p v-for="i in 100" :key="i">{{i}}</p>
            </div>
        </van-pull-refresh>
        


        <van-row type="flex" justify="center">
            <van-col span="22" style="margin-top: 20px;">
                <van-button type="primary" style="width: 100%;">添加地址</van-button>
            </van-col>
        </van-row>

    </div>
</template>

<script>
    import { PullRefresh, List, NavBar, Row, Col, Icon, CellGroup, Cell, Toast, Tabs, Tab, Field, Button } from 'vant'
    import { mapGetters } from 'vuex'

    export default {
        name: 'Banding',
        components: {
            [PullRefresh.name]: PullRefresh,
            [List.name]: List,
            [NavBar.name]: NavBar,
            [Row.name]: Row,
            [Col.name]: Col,
            [Icon.name]: Icon,
            [CellGroup.name]: CellGroup,
            [Cell.name]: Cell,
            [Toast.name]: Toast,
            [Tabs.name]: Tabs,
            [Tab.name]: Tab,
            [Field.name]: Field,
            [Button.name]: Button,
        },
        data() {
            return {
                isLoading: false,
            }
        },
        computed: {
            ...mapGetters(['userinfo'])
        },
        created() {
            
        },
        methods: {
            onClickLeft() {
                this.$router.go(-1)
            },
            onClickRight() {
                Toast('调查问卷')
            },
            //下拉刷新
            onRefresh() {
                //vant下拉加载
                setTimeout(() => {
                    this.$toast("刷新成功");
                    this.isLoading = false;
                }, 500);
            }
        }
    }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
@import "../../assets/styles/common.scss";


</style>